﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="ThisChannel" Object="Channel" InnerID="Request.QueryString['ChannelID']" />
<ali:Get ID="Menu" Object="Channel.Menu" InnerID="Request.QueryString['ID']" Validate="True" />
<script language="c#" runat="server">
protected string GetNamespace(object instanceID)
{
	return Manager.Instances.Select(Alias.Instance.ID + "='" + instanceID + "'")[0][Alias.Module.Namespace].ToString();
}
</script>
<section data-page="channel_menu_edit" data-title="编辑菜单" data-lang="<%=ContentLang%>" data-id="<%=Request.QueryString["ID"]%>" data-operation-id="<%=Menu[OperationID]%>" data-object-id="<%=Menu[ObjectID]%>" data-template-path="<%=Menu[TemplatePath]%>" data-nav="<%=Menu[Nav]%>" data-path-in-template="<%=Menu[PathInTemplate]%>" data-operation-id="<%=Menu[OperationID]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="../list.aspx?Lang=<%=ContentLang%>&amp;ChannelID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">栏目列表</a> → <b class="<%=ContentLang%>Font"><%=ThisChannel[Name]%></b></dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="../edit.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">编辑</a></li>
							<li><a href="../change_template.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">更改模板</a></li>
							<li><a href="../extra_instance.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">栏目邦定</a></li>
							<li><a href="list.aspx?Lang=<%=ContentLang%>&amp;ChannelID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">栏目菜单</a></li>
							<li><a href="add.aspx?Lang=<%=ContentLang%>&amp;ChannelID=<%=Request.QueryString["ChannelID"]%>" target="ali-navtab">添加菜单</a></li>
							<li class="ali-active"><a>编辑菜单</a></li>
						</ul>
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>父菜单：</th>
								<td>
									<select name="ParentID" data-class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="">
										<option data-item="" data-parent="" value="">--未指定--</option>
										<ali:Tree Object="Channel.Menu" Condition="ChannelID=Menu[ChannelID]">
											<ali:Record>
												<%If Guid.Equals(ID, Menu[ParentID])%>
													<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>" selected><%=Name%></option>
												<%Else%>
													<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>"><%=Name%></option>
												<%EndIf%>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>
									</select>
								</td>
							</tr>
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" value="<%=Menu[Name]%>" size="30" maxlength="50" class="ali-input <%=ContentLang%>Font" ></td>
							</tr>
							<tr>
								<th>图片：</th>
								<td><input type="text" name="Picture" value="<%=Menu[Picture]%>" size="60" class="ali-input"><a class="ali-button ali-uploader">浏览...</a><a href="" target="_blank"><img src="" height="22" alt="图片"></a></td>
							</tr>
							<tr data-name="nav">
								<th>导航：</th>
								<td>
									<select name="Nav"<%=(Guid.Equals(Menu[ParentID], Guid.Empty)) ? "" : " disabled"%> data-ali-widget="combo">
										<option value="">-- 默认导航 --</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>网址：</th>
								<td>
									<table>
										<tr>
											<th>类型：</th>
											<td>
												<label><input type="radio" name="PageType" value="template" checked>模板</label>
												<label><input type="radio" name="PageType" value="url">URL</label>
											</td>
										</tr>
										<tr>
											<th>模板：</th>
											<td>
												<select name="TemplatePath" data-ali-widget="combo">
													<option value="">-- 模板路径 --</option>
												</select>
												<select name="PathInTemplate" data-ali-widget="combo">
													<option value="">-- 模板内路径 --</option>
												</select>
												<input type="text" name="Params" value="<%=Menu[Params]%>" size="40" class="ali-input">
											</td>
										</tr>
										<tr style="display:none">
											<th>URL：</th>
											<td><input type="text" name="URL" value="<%=Menu[URL]%>" size="50" maxlength="255" class="ali-input"></td>
										</tr>
										<tr>
											<th>目标：</th>
											<td>
												<input type="text" name="Target" value="<%=Menu[Target]%>" maxlength="50" class="ali-input">
												备选项：
												<select data-name="target-candidate" data-ali-widget="combo">
													<option value="">-- 未指定 --</option>
													<option value="_self">在原窗口打开(_self)</option>
													<option value="_top">在顶层窗口打开(_top)</option>
													<option value="_parent">在父窗口打开(_parent)</option>
													<option value="_blank">在新窗口打开(_blank)</option>
												</select>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<th>权限：</th>
								<td>
									实例：
										<select name="InstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
											<option value="" data-namespace="">-- 未指定 --</option>
											<ali:List Object="Instance">
												<ali:Record>
													<%If Guid.Equals(ID, Menu[InstanceID])%>
														<option value="<%=ID%>" data-namespace="<%=GetNamespace(ID)%>" selected><%=Name%></option>
													<%Else%>
														<option value="<%=ID%>" data-namespace="<%=GetNamespace(ID)%>"><%=Name%></option>
													<%EndIf%>
												</ali:Record>
											</ali:List>
										</select>
									对象：<select name="ObjectID" data-class="<%=ContentLang%>Font" data-ali-widget="combo"><option value="">--未指定--</option></select>
									操作：<select name="OperationID" data-ali-widget="combo"><option value="">--未指定--</option></select>
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button"> 保 存</button></div>
	</form>
</section>